package com.greendeliver.activities;

import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.util.Log;
import android.widget.TabHost;

import com.example.test.R;
import com.greendeliver.activities.base.BaseTabActivity;

public class ServiceDetailActivity extends BaseTabActivity
{

	private static final String	TAG_ID	= "ID_service";
	private String				ID_Service;

	private Intent				i;

	@Override
	protected void onCreate( Bundle savedInstanceState ) {
		super.onCreate( savedInstanceState );
		setFullscreen();
		setContentView( R.layout.activity_service_detail );

		TabHost tabHost = getTabHost();
		Resources res = getResources();
		TabHost.TabSpec spec;
		Intent intent;

		Intent i = getIntent();
		String ID_SERVICE = i.getStringExtra( TAG_ID );

		Log.d( "id", ID_SERVICE );

		intent = new Intent().setClass( this, ServiceInfosDetailActivity.class );
		intent.putExtra( TAG_ID, ID_SERVICE );
		spec = tabHost.newTabSpec( "Form" )
				.setIndicator( "Infos", res.getDrawable( R.drawable.infos ) ).setContent( intent );
		tabHost.addTab( spec );

		intent = new Intent().setClass( this, ServiceScheduleDetailActivity.class );
		intent.putExtra( TAG_ID, ID_SERVICE );
		spec = tabHost.newTabSpec( "Form" )
				.setIndicator( "Horaires", res.getDrawable( R.drawable.schedule ) ).setContent( intent );
		tabHost.addTab( spec );

		intent = new Intent().setClass( this, CustomPlanning_TabGps.class );
		intent.putExtra( TAG_ID, ID_SERVICE );
		intent.putExtra( "ServiceDetail", true );
		spec = tabHost.newTabSpec( "Form" )
				.setIndicator( "Lieu", res.getDrawable( R.drawable.location ) ).setContent( intent );
		tabHost.addTab( spec );

		intent = new Intent().setClass( this, ServiceMenuDetailActivity.class );
		intent.putExtra( TAG_ID, ID_SERVICE );
		spec = tabHost.newTabSpec( "Form" )
				.setIndicator( "Menu(s)", res.getDrawable( R.drawable.menu ) ).setContent( intent );
		tabHost.addTab( spec );

		tabHost.setCurrentTab( intent.getIntExtra( "tab_ServiceInfosDetailActivity", 0 ) );

	}

}
